import React from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
import PersonalDetails from './de/PersonalDetails';

const Detail: React.FC = () => {
  const [searchParams] = useSearchParams();
  const userId = searchParams.get('userId');
  const navigate = useNavigate();

  if (!userId) {
    navigate(-1);
    return null;
  }

  return <PersonalDetails />;
};

export default Detail;
